package cup;

import java.io.IOException;
import java.net.*;

public class TestParser {
	
	static SoloCommandScanner scanner = new SoloCommandScanner(System.in);
	

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		try{
	         ServerSocket listenSocket = new ServerSocket(40000) ;
	         Socket socket = listenSocket.accept();
	         
	         SoloCommandScanner scanner = new SoloCommandScanner(socket.getInputStream());
	         int i=0;
	         while(i++<10)
	         System.out.println(scanner.yylex());
	      }
	      catch (SocketException e){
	         System.out.println("Could not set timeout : " + e.getMessage());
	      }
	      catch (IOException e) {
	         System.out.println("Could not listen on port : " + 4000);
	      }
		/*
		try {
			//parser.parse();
			System.out.println(scanner.yylex());
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}*/

	}

}
